package com.itjiange;

/**
 * 电脑类
 *
 * @author ItJianGe
 * @data 2024/8/27 10:20
 */
public class Computer {

    private ComputerCompose cpu;

    private ComputerCompose memory;

    public Computer() {
        cpu = new Cpu();
        memory = new Memory();
    }

    /**
     * 攒机方法
     *
     * @param visitor
     */
    public void buildComputer(Visitor visitor) {
        cpu.accept(visitor);
        memory.accept(visitor);
    }
}
